//
// Circular Queue
// Created by Xiaoyun on 23.3.25.
//

#ifndef FOC_C_QUEUE_H
#define FOC_C_QUEUE_H

#include <stdint.h>
#include <stdbool.h>

#define MaxSize 10

typedef uint16_t ElemType;

typedef struct {
  int front, rear;
  int size;
  ElemType data[MaxSize];
} CQueue;

void InitQueue(CQueue *Q);

bool QueueEmpty(CQueue Q);

bool QueueFull(CQueue Q);

bool EnQueue(CQueue *Q, ElemType x);

bool DeQueue(CQueue *Q, ElemType *x);

bool GetHead(CQueue Q, ElemType *x);

int GetSize(CQueue Q);  //返回队列元素的个数

#endif //FOC_C_QUEUE_H
